package com.taobao.api.request;

import java.util.Map;

import com.taobao.api.ApiRuleException;
import com.taobao.api.TaobaoRequest;
import com.taobao.api.internal.util.RequestCheckUtils;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.response.VideosDeleteResponse;

/**
 * TOP API: taobao.videos.delete request
 * 
 * @author auto create
 * @since 1.0, 2013-07-21 16:38:14
 */
public class VideosDeleteRequest implements TaobaoRequest<VideosDeleteResponse> {

  private Map<String, String> headerMap = new TaobaoHashMap();
  private TaobaoHashMap       udfParams;                      // add
                                                              // user-defined
                                                              // text parameters
  private Long                timestamp;

  /**
   * 在淘宝视频中的应用key，该值向淘宝视频申请产生
   */
  private Long                videoAppKey;

  /**
   * 视频id列表
   */
  private String              videoIds;

  public void setVideoAppKey(Long videoAppKey) {
    this.videoAppKey = videoAppKey;
  }

  public Long getVideoAppKey() {
    return this.videoAppKey;
  }

  public void setVideoIds(String videoIds) {
    this.videoIds = videoIds;
  }

  public String getVideoIds() {
    return this.videoIds;
  }

  public Long getTimestamp() {
    return this.timestamp;
  }

  public void setTimestamp(Long timestamp) {
    this.timestamp = timestamp;
  }

  public String getApiMethodName() {
    return "taobao.videos.delete";
  }

  public Map<String, String> getTextParams() {
    TaobaoHashMap txtParams = new TaobaoHashMap();
    txtParams.put("video_app_key", this.videoAppKey);
    txtParams.put("video_ids", this.videoIds);
    if (this.udfParams != null) {
      txtParams.putAll(this.udfParams);
    }
    return txtParams;
  }

  public void putOtherTextParam(String key, String value) {
    if (this.udfParams == null) {
      this.udfParams = new TaobaoHashMap();
    }
    this.udfParams.put(key, value);
  }

  public Class<VideosDeleteResponse> getResponseClass() {
    return VideosDeleteResponse.class;
  }

  public void check() throws ApiRuleException {
    RequestCheckUtils.checkNotEmpty(videoAppKey, "videoAppKey");
    RequestCheckUtils.checkNotEmpty(videoIds, "videoIds");
    RequestCheckUtils.checkMaxListSize(videoIds, 100, "videoIds");
  }

  public Map<String, String> getHeaderMap() {
    return headerMap;
  }
}
